revision:
The property returns the viewable width of an element (in pixels), including padding, border and scrollbar, but not the margin. The property is read-only.
Syntax:
element.offsetWidth : the viewable width of the element (in pixels) including padding, border and scrollbar.
property value:
none:
example
<div>
<div id="DIV">
<b>Information about this div:</b><br>
Height: 250px<br>
Width: 400px<br>
Padding: 10px<br>
Margin: 15px<br>
Border: 5px<br>
<p id="prop"></p>
</div>
</div>
<style>
#DIV{height: 250px; width: 400px; padding: 10px; margin: 15px; border: 5px solid red; background-color: lightblue;}
</style>
<script>
const element = document.getElementById("DIV");
let text = "Height including padding and border: " + element.offsetHeight + "px<br>";
text += "Width including padding and border: " + element.offsetWidth + "px";
document.getElementById("prop").innerHTML = text;
</script>